Loading .vscode/settings.json +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ "apidoc", "bccs", "biomejs", "Bluesky", "Bridgy", "btos", "callouts", "cfworker", Loading CHANGES.md +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ To be released. represented as `as:alsoKnownAs` property instead of `alsoKnownAs` property in compacted JSON-LD objects. - Improved compatibility with Bridgy Fed for Bluesky where it puts an invalid URI with the format `at://...` in the `alsoKnownAs` property. Version 1.0.3 ------------- Loading src/codegen/__snapshots__/class.test.ts.snap +485 −97 File changed.Preview size limit exceeded, changes collapsed. Show changes src/codegen/codec.ts +5 −1 Original line number Diff line number Diff line Loading @@ -369,7 +369,11 @@ export async function* generateDecoder( yield ` if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { ${variable}.push(new URL(v["@id"])); ${variable}.push( !URL.canParse(v["@id"]) && v["@id"].startsWith("at://") ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) : new URL(v["@id"]) ); continue; } `; Loading src/vocab/vocab.test.ts +22 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,28 @@ test("Person.fromJsonLd()", async () => { publicKey?.ownerId, new URL("https://todon.eu/users/hongminhee"), ); const person2 = await Person.fromJsonLd({ "@context": [ "https://www.w3.org/ns/activitystreams", { alsoKnownAs: { "@id": "as:alsoKnownAs", "@type": "@id", }, }, ], "type": "Person", // cSpell: disable "alsoKnownAs": "at://did:plc:x7xdowahlhm5xulzqw4ehv6q", // cSpell: enable }); assertEquals( person2.aliasId, // cSpell: disable new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"), // cSpell: enable ); }); test("Person.toJsonLd()", async () => { Loading Loading
.vscode/settings.json +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ "apidoc", "bccs", "biomejs", "Bluesky", "Bridgy", "btos", "callouts", "cfworker", Loading
CHANGES.md +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ To be released. represented as `as:alsoKnownAs` property instead of `alsoKnownAs` property in compacted JSON-LD objects. - Improved compatibility with Bridgy Fed for Bluesky where it puts an invalid URI with the format `at://...` in the `alsoKnownAs` property. Version 1.0.3 ------------- Loading
src/codegen/__snapshots__/class.test.ts.snap +485 −97 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/codegen/codec.ts +5 −1 Original line number Diff line number Diff line Loading @@ -369,7 +369,11 @@ export async function* generateDecoder( yield ` if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { ${variable}.push(new URL(v["@id"])); ${variable}.push( !URL.canParse(v["@id"]) && v["@id"].startsWith("at://") ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) : new URL(v["@id"]) ); continue; } `; Loading
src/vocab/vocab.test.ts +22 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,28 @@ test("Person.fromJsonLd()", async () => { publicKey?.ownerId, new URL("https://todon.eu/users/hongminhee"), ); const person2 = await Person.fromJsonLd({ "@context": [ "https://www.w3.org/ns/activitystreams", { alsoKnownAs: { "@id": "as:alsoKnownAs", "@type": "@id", }, }, ], "type": "Person", // cSpell: disable "alsoKnownAs": "at://did:plc:x7xdowahlhm5xulzqw4ehv6q", // cSpell: enable }); assertEquals( person2.aliasId, // cSpell: disable new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"), // cSpell: enable ); }); test("Person.toJsonLd()", async () => { Loading