Skip to content

Commit

Permalink
Merge tag '0.14.4'
Browse files Browse the repository at this point in the history
Fedify 0.14.4
  • Loading branch information
dahlia committed Sep 6, 2024
2 parents 4fe33d0 + 456206c commit af99094
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ To be released.
object.


Version 0.14.4
--------------

Released on September 6, 2024.

- Fixed a bug of `Object.fromJsonLd()` method where it had thrown
a `TypeError` when the given JSON-LD object had an `@id` property
with an empty string.


Version 0.14.3
--------------

Expand Down Expand Up @@ -154,6 +164,16 @@ Released on August 27, 2024.
[#115]: https://github.com/dahlia/fedify/issues/115


Version 0.13.5
--------------

Released on September 6, 2024.

- Fixed a bug of `Object.fromJsonLd()` method where it had thrown
a `TypeError` when the given JSON-LD object had an `@id` property
with an empty string.


Version 0.13.4
--------------

Expand Down
6 changes: 4 additions & 2 deletions src/codegen/__snapshots__/class.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5404,7 +5404,8 @@ get source(): (Source | null) {

const decoded =
typeof v === \\"object\\" && \\"@id\\" in v
&& typeof v[\\"@id\\"] === \\"string\\" ? new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v
&& typeof v[\\"@id\\"] === \\"string\\"
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? new URL(v[\\"@id\\"]) : 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, options) : undefined
Expand Down Expand Up @@ -38360,7 +38361,8 @@ get units(): (\\"cm\\" | \\"feet\\" | \\"inches\\" | \\"km\\" | \\"m\\" | \\"mil
const decoded =
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\\"] : typeof v === \\"object\\" && \\"@id\\" in v
&& typeof v[\\"@id\\"] === \\"string\\" ? new URL(v[\\"@id\\"]) : undefined
&& typeof v[\\"@id\\"] === \\"string\\"
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? new URL(v[\\"@id\\"]) : undefined
;
if (typeof decoded === \\"undefined\\") continue;
_oKrwxU4V8wiKhMW1QEYQibcJh8c.push(decoded);
Expand Down
3 changes: 2 additions & 1 deletion src/codegen/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ const scalarTypes: Record<string, ScalarType> = {
},
dataCheck(v) {
return `typeof ${v} === "object" && "@id" in ${v}
&& typeof ${v}["@id"] === "string"`;
&& typeof ${v}["@id"] === "string"
&& ${v}["@id"] !== "" && ${v}["@id"] !== "/"`;
},
decoder(v) {
return `new URL(${v}["@id"])`;
Expand Down

0 comments on commit af99094

Please sign in to comment.