Skip to content

Commit ea85693

Browse files
committed
show bytes of getItem str in debug
1 parent 1bb34a3 commit ea85693

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/idb-cache/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,11 @@ export class IDBCache implements IDBCacheInterface {
534534

535535
const duration = Date.now() - startTime;
536536
if (this.debug && duration > DURATION_THRESHOLD) {
537-
console.debug(`getItem for key ${itemKey} took ${duration}ms`);
537+
console.debug(
538+
`getItem for key ${itemKey} took ${duration}ms for ${
539+
new TextEncoder().encode(decryptedChunks.join("")).length
540+
} bytes`
541+
);
538542
}
539543

540544
return decryptedChunks.join("");

0 commit comments

Comments
 (0)