Skip to content

Commit be93e07

Browse files
committed
fix: replace deprecated iter method with a better alternative
1 parent f3beb1e commit be93e07

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dev_deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
assertThrowsAsync,
55
} from "https://deno.land/[email protected]/testing/asserts.ts";
66
export { createHash } from "https://deno.land/[email protected]/hash/mod.ts";
7+
export { iterateReader } from "https://deno.land/[email protected]/streams/conversion.ts";
78
export { stub } from "https://deno.land/x/[email protected]/mod.ts";
89
export type { Stub } from "https://deno.land/x/[email protected]/mod.ts";
910
export type { SupportedAlgorithm } from "https://deno.land/[email protected]/hash/mod.ts";

tests/helpers/io.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createHash } from "../../dev_deps.ts";
1+
import { createHash, iterateReader } from "../../dev_deps.ts";
22
import type { SupportedAlgorithm } from "../../dev_deps.ts";
33

44
export const calculateFileHash = async (
@@ -7,7 +7,7 @@ export const calculateFileHash = async (
77
): Promise<string> => {
88
const hash = createHash(hashMethod);
99
const file = await Deno.open(filePath);
10-
for await (const chunk of Deno.iter(file)) {
10+
for await (const chunk of iterateReader(file)) {
1111
hash.update(chunk);
1212
}
1313
Deno.close(file.rid);

0 commit comments

Comments
 (0)