@dxos/credentials 0.5.2-main.2408cc7 → 0.5.2-main.80497e2

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.
@@ -34,9 +34,6 @@ var getCredentialProofPayload = (credential) => {
34
34
  chain: void 0
35
35
  }
36
36
  };
37
- if (copy.parentCredentialIds?.length === 0) {
38
- delete copy.parentCredentialIds;
39
- }
40
37
  delete copy.id;
41
38
  return Buffer.from(canonicalStringify(copy));
42
39
  };
@@ -87,15 +84,7 @@ var truncateKey = (key) => {
87
84
  // packages/core/halo/credentials/src/presentations/signing.ts
88
85
  var getPresentationProofPayload = (credentials, proof) => {
89
86
  const copy = {
90
- credentials: credentials.map((credential) => {
91
- const copy2 = {
92
- ...credential
93
- };
94
- if (copy2.parentCredentialIds?.length === 0) {
95
- delete copy2.parentCredentialIds;
96
- }
97
- return copy2;
98
- }),
87
+ credentials,
99
88
  proof: {
100
89
  ...proof,
101
90
  value: new Uint8Array(),
@@ -228,7 +217,6 @@ var createCredential = async ({ signer, issuer, subject, assertion, signingKey,
228
217
  id: subject,
229
218
  assertion
230
219
  },
231
- parentCredentialIds,
232
220
  proof: {
233
221
  type: SIGNATURE_TYPE_ED25519,
234
222
  creationDate: /* @__PURE__ */ new Date(),
@@ -237,6 +225,9 @@ var createCredential = async ({ signer, issuer, subject, assertion, signingKey,
237
225
  nonce
238
226
  }
239
227
  };
228
+ if ((parentCredentialIds?.length ?? 0) > 0) {
229
+ credential.parentCredentialIds = parentCredentialIds;
230
+ }
240
231
  const signedPayload = getCredentialProofPayload(credential);
241
232
  credential.proof.value = await signer.sign(signingKey ?? issuer, signedPayload);
242
233
  if (chain) {