lint 로직 변경

This commit is contained in:
2026-01-15 14:58:44 +00:00
parent 62279dc587
commit 24fbace987
11 changed files with 33 additions and 20 deletions
+3 -7
View File
@@ -1,14 +1,10 @@
import { sha512 as sha512Noble } from '@noble/hashes/sha2.js';
import type { createHash } from 'node:crypto';
import type { BytesLike } from './BytesLike.js';
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array.js';
type NodeHash = {
update(data: Uint8Array): NodeHash;
digest(): Uint8Array;
};
type NodeCreateHash = (algorithm: 'sha512') => NodeHash;
type NodeCreateHash = typeof createHash;
const isNode = typeof process !== 'undefined' && typeof process.versions?.node === 'string';
@@ -17,7 +13,7 @@ const nodeCryptoSpecifier = 'node:crypto';
let nodeCreateHash: NodeCreateHash | null = null;
if (isNode) {
const nodeCrypto = (await import(nodeCryptoSpecifier)) as typeof import('node:crypto');
const nodeCrypto = await import(nodeCryptoSpecifier);
nodeCreateHash = nodeCrypto.createHash as NodeCreateHash;
}