Loading .gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line deno.lock codegen/class.ts +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ export async function* generateClasses( runtimePath: string, ): AsyncIterable<string> { runtimePath = runtimePath.replace(/\/+$/, ""); yield "// deno-lint-ignore-file ban-unused-ignore\n"; yield 'import jsonld from "npm:jsonld@8.3.2";'; yield `import { LanguageTag, parseLanguageTag } from "npm:@phensley/language-tag@1.8.0";\n`; Loading codegen/codec.ts +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ export async function* generateEncoder( ...options, documentLoader: options.documentLoader ?? fetchDocumentLoader, }; // deno-lint-ignore no-unused-vars prefer-const let array: unknown[]; `; if (type.extends == null) { Loading Loading @@ -90,6 +91,7 @@ export async function* generateDecoder( documentLoader: options.documentLoader ?? fetchDocumentLoader, }; const expanded = await jsonld.expand(json, options); // deno-lint-ignore no-explicit-any const values = expanded[0] as (Record<string, any[]> & { "@id"?: string }); `; const subtypes = getSubtypes(typeUri, types, true); Loading codegen/constructor.ts +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ export async function* generateCloner( yield ` = {}): ${type.name} {\n`; if (type.extends == null) { yield ` // @ts-ignore // @ts-ignore: this.constructor is not recognized as a constructor, but it is. const clone: ${type.name} = new this.constructor({ id: values.id }); `; } else { Loading codegen/inspector.ts +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ) => "URL " + inspect(this.id!.href), ) => "URL " + inspect(this.id!.href, options), }; } `; Loading @@ -37,7 +37,7 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ) => "URL " + inspect(v.href) ) => "URL " + inspect(v.href, options) } : v); `; Loading Loading
codegen/class.ts +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ export async function* generateClasses( runtimePath: string, ): AsyncIterable<string> { runtimePath = runtimePath.replace(/\/+$/, ""); yield "// deno-lint-ignore-file ban-unused-ignore\n"; yield 'import jsonld from "npm:jsonld@8.3.2";'; yield `import { LanguageTag, parseLanguageTag } from "npm:@phensley/language-tag@1.8.0";\n`; Loading
codegen/codec.ts +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ export async function* generateEncoder( ...options, documentLoader: options.documentLoader ?? fetchDocumentLoader, }; // deno-lint-ignore no-unused-vars prefer-const let array: unknown[]; `; if (type.extends == null) { Loading Loading @@ -90,6 +91,7 @@ export async function* generateDecoder( documentLoader: options.documentLoader ?? fetchDocumentLoader, }; const expanded = await jsonld.expand(json, options); // deno-lint-ignore no-explicit-any const values = expanded[0] as (Record<string, any[]> & { "@id"?: string }); `; const subtypes = getSubtypes(typeUri, types, true); Loading
codegen/constructor.ts +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ export async function* generateCloner( yield ` = {}): ${type.name} {\n`; if (type.extends == null) { yield ` // @ts-ignore // @ts-ignore: this.constructor is not recognized as a constructor, but it is. const clone: ${type.name} = new this.constructor({ id: values.id }); `; } else { Loading
codegen/inspector.ts +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ) => "URL " + inspect(this.id!.href), ) => "URL " + inspect(this.id!.href, options), }; } `; Loading @@ -37,7 +37,7 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ) => "URL " + inspect(v.href) ) => "URL " + inspect(v.href, options) } : v); `; Loading