Skip to content

Commit

Permalink
🤖 🎨 Autoformat
Browse files Browse the repository at this point in the history
Signed-off-by: sivanov <[email protected]>
  • Loading branch information
ivanovSPvirtru committed Sep 8, 2023
1 parent 034d41e commit 8479fcf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/tdf3/src/binary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ArrayBufferBinary extends Binary {

override asHex(): string {
return Array.from(new Uint8Array(this.value))
.map(byte => byte.toString(16).padStart(2, '0'))
.map((byte) => byte.toString(16).padStart(2, '0'))
.join('');
}

Expand Down Expand Up @@ -152,7 +152,7 @@ class ByteArrayBinary extends Binary {
}

override asHex(): string {
return this.value.map(byte => byte.toString(16).padStart(2, '0')).join('');
return this.value.map((byte) => byte.toString(16).padStart(2, '0')).join('');
}

override isByteArray(): boolean {
Expand Down Expand Up @@ -201,13 +201,13 @@ class StringBinary extends Binary {

override asB64(): string {
const uint8Array = new TextEncoder().encode(this.asString());
const charArray = Array.from(uint8Array, byte => String.fromCharCode(byte));
const charArray = Array.from(uint8Array, (byte) => String.fromCharCode(byte));
return btoa(charArray.join(''));
}

override asHex(): string {
return Array.from(new TextEncoder().encode(this.value))
.map(byte => byte.toString(16).padStart(2, '0'))
.map((byte) => byte.toString(16).padStart(2, '0'))
.join('');
}

Expand Down
5 changes: 1 addition & 4 deletions lib/tdf3/src/tdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,7 @@ export class TDF extends EventEmitter {
return hex.encodeArrayBuffer(new Uint8Array(payloadBinary.asByteArray()).slice(-16).buffer);
case 'hs256':
// simple hmac is the default
return await this.cryptoService.hmac(
unwrappedKeyBinary.asHex(),
payloadBinary.asString()
);
return await this.cryptoService.hmac(unwrappedKeyBinary.asHex(), payloadBinary.asString());
default:
throw new IllegalArgumentError(`Unsupported signature alg [${algorithmType}]`);
}
Expand Down
6 changes: 5 additions & 1 deletion lib/tdf3/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export function base64ToBuffer(b64: string): Uint8Array {
}

export function bufferToBase64(slice: Uint8Array) {
return btoa(Array.from(slice).map(byte => String.fromCharCode(byte)).join(''));
return btoa(
Array.from(slice)
.map((byte) => String.fromCharCode(byte))
.join('')
);
}

export function isAppIdProviderCheck(
Expand Down

0 comments on commit 8479fcf

Please sign in to comment.