Unverified Commit 9545a7a2 authored by Hong Minhee's avatar Hong Minhee
Browse files

Ignore incorrectly typed `CryptographicKey`s

parent 6701b6a8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@
    "multibase",
    "multikey",
    "multitenancy",
    "Nexkey",
    "nodeinfo",
    "phensley",
    "Pico",
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ Version 1.0.3

To be released.

 -  Improved compatibility with some implementations (e.g., Nexkey) where
    some `CryptographicKey` objects are incorrectly typed in JSON-LD objects.


Version 1.0.2
-------------
+252 −126

File changed.

Preview size limit exceeded, changes collapsed.

+4 −1
Original line number Diff line number Diff line
@@ -302,7 +302,10 @@ export async function* generateDecoder(
    }
  `;
  const subtypes = getSubtypes(typeUri, types, true);
  yield 'if ("@type" in values) {\n';
  yield `
  if ("@type" in values &&
      !values["@type"].every(t => t.startsWith("_:"))) {
  `;
  for (const subtypeUri of subtypes) {
    yield `
    if (values["@type"].includes(${JSON.stringify(subtypeUri)})) {
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
    ".zed/",
    "apidoc/",
    "cli/",
    "codegen/schema.yaml",
    "docs/",
    "examples/",
    "logo.svg",