@dxos/credentials 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/index.mjs +13 -5
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/types/src/credentials/signing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/credentials/signing.ts +22 -8
|
@@ -60,13 +60,21 @@ var getCredentialProofPayload = (credential) => {
|
|
|
60
60
|
delete copy.parentCredentialIds;
|
|
61
61
|
}
|
|
62
62
|
delete copy.id;
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const originalAssertion = copy.subject?.assertion;
|
|
64
|
+
if (originalAssertion) {
|
|
65
|
+
const normalizedAssertion = {
|
|
66
|
+
...originalAssertion
|
|
67
|
+
};
|
|
68
|
+
for (const key of Object.keys(normalizedAssertion)) {
|
|
69
|
+
const val = normalizedAssertion[key];
|
|
70
|
+
if (val === void 0 || val === null || val === 0 || val === "" || val === false || Array.isArray(val) && val.length === 0) {
|
|
71
|
+
delete normalizedAssertion[key];
|
|
68
72
|
}
|
|
69
73
|
}
|
|
74
|
+
copy.subject = {
|
|
75
|
+
...copy.subject,
|
|
76
|
+
assertion: normalizedAssertion
|
|
77
|
+
};
|
|
70
78
|
}
|
|
71
79
|
return Buffer.from(canonicalStringify(copy));
|
|
72
80
|
};
|