diff --git a/src/common/common.test.ts b/src/common/common.test.ts index e61e1aac..1dfdfe4b 100644 --- a/src/common/common.test.ts +++ b/src/common/common.test.ts @@ -1005,7 +1005,10 @@ describe("getVerifiableCredential", () => { DataFactory.quad( DataFactory.namedNode("https://some.webid.provider/strelka"), DataFactory.namedNode("https://example.org/predicateTrue"), - DataFactory.literal("true", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")), + DataFactory.literal( + "true", + DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"), + ), ), ); @@ -1013,7 +1016,10 @@ describe("getVerifiableCredential", () => { DataFactory.quad( DataFactory.namedNode("https://some.webid.provider/strelka"), DataFactory.namedNode("https://example.org/predicateFalse"), - DataFactory.literal("false", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")), + DataFactory.literal( + "false", + DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"), + ), ), ); @@ -1021,7 +1027,10 @@ describe("getVerifiableCredential", () => { DataFactory.quad( DataFactory.namedNode("https://some.webid.provider/strelka"), DataFactory.namedNode("https://example.org/predicateFalse"), - DataFactory.literal("false", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")), + DataFactory.literal( + "false", + DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"), + ), ), ); @@ -1029,7 +1038,9 @@ describe("getVerifiableCredential", () => { DataFactory.quad( DataFactory.namedNode("https://some.webid.provider/strelka"), DataFactory.namedNode("https://w3id.org/GConsent#forPurpose"), - DataFactory.namedNode("http://example.org/known/to/be/iri/from/predicate"), + DataFactory.namedNode( + "http://example.org/known/to/be/iri/from/predicate", + ), ), ); @@ -1067,7 +1078,7 @@ describe("getVerifiableCredential", () => { "https://example.org/predicateBnode": {}, "https://example.org/predicateFalse": false, "https://example.org/predicateTrue": true, - forPurpose: "http://example.org/known/to/be/iri/from/predicate" + forPurpose: "http://example.org/known/to/be/iri/from/predicate", }, // Any types outside of those in our VC and Inrupt context are removed type: ["VerifiableCredential"], diff --git a/src/common/common.ts b/src/common/common.ts index 2dee8042..9d8da191 100644 --- a/src/common/common.ts +++ b/src/common/common.ts @@ -681,6 +681,7 @@ export async function getVerifiableCredentialFromStore( const compact = customContext.compactIri(predicate, true); const termContext = customContext.getContextRaw()[compact]; const term = Util.termToValue(object, customContext, { + // FIXME: This could also be @json, xsd:type - so this needs to be more strict // If an `@type` is defined in the context, then the // parser can determine that it is an IRI immediately // and so we don't need to wrap it in an object with an diff --git a/src/parser/jsonld.test.ts b/src/parser/jsonld.test.ts index 705eae90..9006e35d 100644 --- a/src/parser/jsonld.test.ts +++ b/src/parser/jsonld.test.ts @@ -117,9 +117,13 @@ describe("jsonLdResponseToStore", () => { issuer: "https://some.example", }), ); - await expect(jsonLdResponseToStore(response, { - allowContextFetching: false - })).rejects.toThrowError('Unexpected context requested [http://example.org/my/remote/context]'); + await expect( + jsonLdResponseToStore(response, { + allowContextFetching: false, + }), + ).rejects.toThrow( + "Unexpected context requested [http://example.org/my/remote/context]", + ); }); it("converting fetch response with custom prefix definition to a store", async () => {