Skip to content

Commit b34d408

Browse files
committed
Merge tag '0.13.5' into 0.14-maintenance
Fedify 0.13.5
2 parents c0bce02 + b4ace75 commit b34d408

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

CHANGES.md

+14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Version 0.14.4
88

99
To be released.
1010

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

1216
Version 0.14.3
1317
--------------
@@ -134,6 +138,16 @@ Released on August 27, 2024.
134138
[#115]: https://github.com/dahlia/fedify/issues/115
135139

136140

141+
Version 0.13.5
142+
--------------
143+
144+
Released on September 6, 2024.
145+
146+
- Fixed a bug of `Object.fromJsonLd()` method where it had thrown
147+
a `TypeError` when the given JSON-LD object had an `@id` property
148+
with an empty string.
149+
150+
137151
Version 0.13.4
138152
--------------
139153

src/codegen/__snapshots__/class.test.ts.snap

+4-2
Original file line numberDiff line numberDiff line change
@@ -5417,7 +5417,8 @@ get source(): (Source | null) {
54175417

54185418
const decoded =
54195419
typeof v === \\"object\\" && \\"@id\\" in v
5420-
&& typeof v[\\"@id\\"] === \\"string\\" ? new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v
5420+
&& typeof v[\\"@id\\"] === \\"string\\"
5421+
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v
54215422
&& 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(
54225423
t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd(
54235424
v, options) : undefined
@@ -38971,7 +38972,8 @@ get units(): (\\"cm\\" | \\"feet\\" | \\"inches\\" | \\"km\\" | \\"m\\" | \\"mil
3897138972
const decoded =
3897238973
typeof v === \\"object\\" && \\"@value\\" in v
3897338974
&& (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
38974-
&& typeof v[\\"@id\\"] === \\"string\\" ? new URL(v[\\"@id\\"]) : undefined
38975+
&& typeof v[\\"@id\\"] === \\"string\\"
38976+
&& v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? new URL(v[\\"@id\\"]) : undefined
3897538977
;
3897638978
if (typeof decoded === \\"undefined\\") continue;
3897738979
_oKrwxU4V8wiKhMW1QEYQibcJh8c.push(decoded);

src/codegen/type.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ const scalarTypes: Record<string, ScalarType> = {
140140
},
141141
dataCheck(v) {
142142
return `typeof ${v} === "object" && "@id" in ${v}
143-
&& typeof ${v}["@id"] === "string"`;
143+
&& typeof ${v}["@id"] === "string"
144+
&& ${v}["@id"] !== "" && ${v}["@id"] !== "/"`;
144145
},
145146
decoder(v) {
146147
return `new URL(${v}["@id"])`;

0 commit comments

Comments
 (0)