Skip to content

Commit

Permalink
Merge pull request #7 from hayd/0.42.0
Browse files Browse the repository at this point in the history
Update to 0.42.0 and require --unstable
  • Loading branch information
hayd authored May 4, 2020
2 parents 296a2ee + 9823b4e commit b912123
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _JSZip from "https://dev.jspm.io/[email protected]";
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,
Expand Down Expand Up @@ -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()!);
Expand Down
12 changes: 6 additions & 6 deletions test.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -35,7 +35,7 @@ async function exampleDir(): Promise<string> {
return dir;
}

Deno.test(async function read() {
Deno.test("read", async () => {
await exampleZip("example.zip");

const z = await readZip("example.zip");
Expand All @@ -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);

Expand All @@ -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");
Expand Down

0 comments on commit b912123

Please sign in to comment.