Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed-Mamoun98 committed Dec 17, 2024
1 parent 776c575 commit 910842d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/idos-sdk-js/src/lib/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Data {
constructor(
public readonly kwilWrapper: KwilWrapper,
public readonly enclave: Enclave,
) { }
) {}

singularize(tableName: string): string {
return tableName.replace(/s$/, "");
Expand Down Expand Up @@ -80,7 +80,7 @@ export class Data {

if (tableName === "credentials") {
recipientEncryptionPublicKey ??= base64Encode(await this.enclave.ready());
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey")
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey");

for (const record of records) {
Object.assign(
Expand Down Expand Up @@ -132,7 +132,7 @@ export class Data {

if (tableName === "credentials") {
recipientEncryptionPublicKey ??= base64Encode(await this.enclave.ready());
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey")
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey");

Object.assign(
record,
Expand Down Expand Up @@ -269,7 +269,7 @@ export class Data {

if (tableName === "credentials") {
recipientEncryptionPublicKey ??= base64Encode(await this.enclave.ready());
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey")
if (!recipientEncryptionPublicKey) throw new Error("Missing recipientEncryptionPublicKey");

Object.assign(
record,
Expand Down
6 changes: 4 additions & 2 deletions packages/idos-sdk-js/src/lib/enclave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Enclave {
constructor(
public readonly auth: Auth,
public readonly provider: EnclaveProvider,
) { }
) {}

async load() {
await this.provider.load();
Expand Down Expand Up @@ -48,7 +48,9 @@ export class Enclave {

const { content, encryptorPublicKey } = await this.provider.encrypt(
utf8Encode(message),
recipientEncryptionPublicKey === undefined ? undefined : base64Decode(recipientEncryptionPublicKey),
recipientEncryptionPublicKey === undefined
? undefined
: base64Decode(recipientEncryptionPublicKey),
);

return {
Expand Down

0 comments on commit 910842d

Please sign in to comment.