Skip to content

Commit 2548564

Browse files
committed
Re-export normalizeLinkToImage and fix root @id resolution
Export normalizeLinkToImage from @fedify/vocab entry point and use the pre-resolved _resolvedUrl for the root instance id instead of constructing a new URL directly. Also fix a JSDoc {@link} tag in schema.ts. #793 (comment) #793 (comment) #793 (comment) Assisted-by: OpenCode:deepseek-v4-pro
1 parent 0749718 commit 2548564

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/vocab-tools/src/codec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export async function* generateDecoder(
437437
if (type.extends == null) {
438438
yield `
439439
const instance = new this(
440-
{ id: "@id" in values ? new URL(values["@id"] as string) : undefined },
440+
{ id: _resolvedUrl },
441441
options,
442442
);
443443
`;

packages/vocab-tools/src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export interface PropertySchemaBase {
129129
* property's declared range, `undefined` when it did not handle the value,
130130
* or an `Error` when it recognized the value but failed while converting it.
131131
*
132-
* {@link module} is resolved from the generated vocabulary source file
132+
* `module` is resolved from the generated vocabulary source file
133133
* and imported dynamically at decode time.
134134
*/
135135
preprocessors?: PropertyPreprocessorSchema[];

packages/vocab/src/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export * from "./actor.ts";
5353
export * from "./constants.ts";
5454
export * from "./handle.ts";
5555
export * from "./lookup.ts";
56+
export * from "./preprocessors.ts";
5657
export * from "./type.ts";
5758
export * from "./vocab.ts";
5859
export { LanguageString } from "@fedify/vocab-runtime";

0 commit comments

Comments
 (0)