From e93e847a1a868321354358979f2dacd4b6beb3b7 Mon Sep 17 00:00:00 2001 From: Ilya Bogdanov Date: Thu, 2 Nov 2023 17:01:05 +0400 Subject: [PATCH] Fix lints --- app/gui2/shared/languageServer.ts | 6 +++--- app/gui2/src/components/GraphEditor/upload.ts | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/gui2/shared/languageServer.ts b/app/gui2/shared/languageServer.ts index 61d2febafbbc..bfead31c9efa 100644 --- a/app/gui2/shared/languageServer.ts +++ b/app/gui2/shared/languageServer.ts @@ -1,6 +1,6 @@ -import { Client } from '@open-rpc/client-js' -import { sha3_224 } from '@noble/hashes/sha3' +import { sha3_224 as SHA3 } from '@noble/hashes/sha3' import { bytesToHex } from '@noble/hashes/utils' +import { Client } from '@open-rpc/client-js' import { ObservableV2 } from 'lib0/observable' import { uuidv4 } from 'lib0/random' import { z } from 'zod' @@ -384,5 +384,5 @@ export class LanguageServer extends ObservableV2 { } export function computeTextChecksum(text: string): Checksum { - return bytesToHex(sha3_224.create().update(text).digest()) as Checksum + return bytesToHex(SHA3.create().update(text).digest()) as Checksum } diff --git a/app/gui2/src/components/GraphEditor/upload.ts b/app/gui2/src/components/GraphEditor/upload.ts index 53dbd21ccbca..23994dbb92b7 100644 --- a/app/gui2/src/components/GraphEditor/upload.ts +++ b/app/gui2/src/components/GraphEditor/upload.ts @@ -1,4 +1,4 @@ -import { sha3_224, Keccak } from '@noble/hashes/sha3' +import { Keccak, sha3_224 as SHA3 } from '@noble/hashes/sha3' import type { Hash } from '@noble/hashes/utils' import { bytesToHex } from '@noble/hashes/utils' import type { DataServer } from 'shared/dataServer' @@ -22,7 +22,7 @@ export class Uploader { this.binary = binary this.file = file this.projectRootId = projectRootId - this.checksum = sha3_224.create() + this.checksum = SHA3.create() this.uploadedBytes = BigInt(0) } @@ -69,9 +69,7 @@ export class Uploader { const hexChecksum = bytesToHex(this.checksum.digest()) if (hexChecksum != engineChecksum.checksum) { throw new Error( - `Uploading file failed, checksum does not match. ${hexChecksum} != ${ - engineChecksum.checksum - }`, + `Uploading file failed, checksum does not match. ${hexChecksum} != ${engineChecksum.checksum}`, ) } }