From 9823b4eda5d529d4024c2fbe4836f2d5caf96bcc Mon Sep 17 00:00:00 2001 From: Andy Hayden Date: Mon, 4 May 2020 16:17:58 -0700 Subject: [PATCH] Update to 0.42.0 and require --unstable --- .github/workflows/ci.yml | 2 +- mod.ts | 10 +++++----- test.ts | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e6f7e4..84bfc95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: denolib/setup-deno@master with: - deno-version: 0.41.0 + deno-version: 0.42.0 - name: Run tests run: deno test --allow-write --allow-read diff --git a/mod.ts b/mod.ts index 36685cf..c178a70 100644 --- a/mod.ts +++ b/mod.ts @@ -1,6 +1,6 @@ import _JSZip from "https://dev.jspm.io/jszip@3.4.0"; -import { WalkOptions, walk } from "https://deno.land/std@v0.41.0/fs/mod.ts"; -import { SEP, join } from "https://deno.land/std@v0.41.0/path/mod.ts"; +import { WalkOptions, walk } from "https://deno.land/std@v0.42.0/fs/mod.ts"; +import { SEP, join } from "https://deno.land/std@v0.42.0/path/mod.ts"; import { InputFileFormat, JSZipFileOptions, @@ -39,14 +39,14 @@ export async function zipDir( Deno.chdir(dir); try { for await (const f of walk(".", options)) { - if (f.info.isDirectory) { + if (f.isDirectory) { // skip directories continue; } - const contents = await Deno.readFile(f.filename); + const contents = await Deno.readFile(f.path); // In order to support Windows we do this ridiculousness. - let ff = f.filename.split(SEP); + let ff = f.path.split(SEP); let zz = z; while (ff.length > 1) { zz = zz.folder(ff.shift()!); diff --git a/test.ts b/test.ts index 4825758..aefdcc4 100644 --- a/test.ts +++ b/test.ts @@ -1,6 +1,6 @@ -import { decode, encode } from "https://deno.land/std@v0.41.0/encoding/utf8.ts"; -import { join } from "https://deno.land/std@v0.41.0/path/mod.ts"; -import { assertEquals } from "https://deno.land/std@v0.41.0/testing/asserts.ts"; +import { decode, encode } from "https://deno.land/std@v0.42.0/encoding/utf8.ts"; +import { join } from "https://deno.land/std@v0.42.0/path/mod.ts"; +import { assertEquals } from "https://deno.land/std@v0.42.0/testing/asserts.ts"; import { JSZip, readZip, zipDir } from "./mod.ts"; // FIXME use tmp directory and clean up. @@ -35,7 +35,7 @@ async function exampleDir(): Promise { return dir; } -Deno.test(async function read() { +Deno.test("read", async () => { await exampleZip("example.zip"); const z = await readZip("example.zip"); @@ -52,7 +52,7 @@ Deno.test(async function read() { // TODO add tests for unzip -Deno.test(async function dir() { +Deno.test("dir", async () => { const dir = await exampleDir(); const z = await zipDir(dir); @@ -63,7 +63,7 @@ Deno.test(async function dir() { assertEquals(img.file("smile.gif").name, "images/smile.gif"); }); -Deno.test(async function unzip() { +Deno.test("unzip", async () => { const dir = await Deno.makeTempDir(); await exampleZip("example.zip"); const z = await readZip("example.zip");