Skip to content

Commit

Permalink
Merge pull request #69 from Indicio-tech/fix/multiple-services
Browse files Browse the repository at this point in the history
chore: Cleanup parsing code
  • Loading branch information
dbluhm committed Jan 6, 2024
2 parents 109a9cc + e7996c7 commit 73a0453
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/peer2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export default class DIDPeer {
const doc: any = {
"@context": "https://www.w3.org/ns/did/v1",
id: did,
service: [],
}
let serviceIndex = 0;

Expand Down Expand Up @@ -238,7 +237,10 @@ export default class DIDPeer {
})
.map(DIDPeer.transformOldServiceStyleToNew)

doc.service.push(...services)
if (!Array.isArray(doc.service)) {
doc.service = [];
}
doc.service.concat(services)
break
}

Expand Down

0 comments on commit 73a0453

Please sign in to comment.